-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce stack usage #190
Reduce stack usage #190
Conversation
@MathiasKoch please have a look :) |
I am not sure if I understand how this reduces stack usage? It makes it easier to be certain you have enough stack available, as you do the allocation up front, but wouldn't you still need the same size, with the limitation that it is much harder to calculate now, as you need to know up from what the serialized size of your biggest command + arguments is throughout the entire program? |
@rmja Is this still relevant? |
Yes, I believe so. This PR also removed 2k of my code size. Please come with any good ideas on how to improve it further. |
@dragonnn could you verify that this in fact reduce the stack usage? I known that we still need to handle the stack usage of the response. |
Yes, it does. Helps already a lot, thanks :) |
@dragonnn awesome! The last few commits depends on embassy-rs/embassy#2328. |
@rmja This looks nice! Could you fix the CI? |
Ok, I need some help. Can anyone help with getting these two tests back? |
What is the issue with them? (don't have the option of checking out the branch right now) |
OMG: CI is green! I would really appreciate if the two of you could have a look again! |
Works fine in my project, didn't notice any issue and no changes where need from previous commit I tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Thank you very much for your efforts on this!
Can't wait to try it out on my own devices. Sadly, I still have a bit of way on migrating blocking code to async before I can fully upgrade.
This is a proposal to write request to a re-useable buffer instead of allocating the heapless Vec on the stack.
If this is something that we decide to go with, then we should also do something to reuse the same buffer when parsing the response.
Note, there is a todo in
serde_at/src/ser/mod.rs
when compiled without heapless.